{
 "cells": [
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T08:52:52.181683Z",
     "start_time": "2025-09-26T08:52:52.177452Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "arr1d=np.array([1,2,3])"
   ],
   "id": "b3c4544839726d97",
   "outputs": [],
   "execution_count": 7
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T08:54:06.405477Z",
     "start_time": "2025-09-26T08:54:06.399830Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "arr2d=np.array([[1,2,3],[4,5,6],[7,8,9]])"
   ],
   "id": "7e7c1c1770c0dbbf",
   "outputs": [],
   "execution_count": 11
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T08:57:28.441170Z",
     "start_time": "2025-09-26T08:57:28.436183Z"
    }
   },
   "cell_type": "code",
   "source": [
    "import numpy as np\n",
    "arr3d=np.array([[1,2,3],[4,5,6],[7,8,9]])"
   ],
   "id": "8d29edc9d7b12947",
   "outputs": [],
   "execution_count": 12
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T08:59:49.951729Z",
     "start_time": "2025-09-26T08:59:49.945450Z"
    }
   },
   "cell_type": "code",
   "source": "np.empty((2,3))",
   "id": "bbc2c563a072233c",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[6.23042070e-307, 4.67296746e-307, 1.69121096e-306],\n",
       "       [1.33508930e-307, 1.89146896e-307, 7.56571288e-307]])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 14
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T09:02:54.342418Z",
     "start_time": "2025-09-26T09:02:54.334325Z"
    }
   },
   "cell_type": "code",
   "source": [
    "np.linspace(1,20,6)\n",
    "#array([1.,4.8,8.6,12.4,16.2,20.])"
   ],
   "id": "5a214172fa95d917",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1. ,  4.8,  8.6, 12.4, 16.2, 20. ])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 17
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T09:16:35.647918Z",
     "start_time": "2025-09-26T09:16:35.637809Z"
    }
   },
   "cell_type": "code",
   "source": [
    "data=np.array([[1,2,3],[4,5,6]])\n",
    "float_data=data.astype(np.float32)\n",
    "float_data.dtype.name"
   ],
   "id": "e7565619788e8e5",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'float32'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 19
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T09:19:07.187129Z",
     "start_time": "2025-09-26T09:19:07.179780Z"
    }
   },
   "cell_type": "code",
   "source": [
    "float_data=np.array([1.2,2.9,3.5])\n",
    "int_data=data.astype(np.int32)\n",
    "int_data"
   ],
   "id": "c6ad64b053dff9ad",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [4, 5, 6]], dtype=int32)"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 21
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-09-26T09:24:13.515183Z",
     "start_time": "2025-09-26T09:24:13.507516Z"
    }
   },
   "cell_type": "code",
   "source": [
    "str_data=np.array(['1','2','3'])\n",
    "int_data=str_data.astype(np.int64)\n",
    "int_data"
   ],
   "id": "6bd1ed42d44996fe",
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "execution_count": 22
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
